﻿{% extends "base.html" %}
{% block content %}
	<style><!--
	#test {margin: 30px 40px 0 40px}
	#intro {margin-top: 20px}
	#time {margin-bottom: 20px}
	#footer {margin: 20px 40px 40px 40px }
	//--></style>
	<script type="text/javascript"> 
	$(document).ready(function() { 
		$('#reg').validate({ 
					rules: { 
							name: { required:true },
							sid: { required:true, rangelength:[10,10] },
							classno: { required:true, rangelength:[8,8] },
							phone: { required:true, rangelength:[11,11] },
							email: { required: true, email: true, }
							},
					messages: {
							name:{ required:'请输入姓名' },
							sid: { required:'请输入学号', rangelength: '学号长度为10'},
							classno: { required:'请输入班级号', rangelength: '班级号长度为8' },
							phone: { required:'请输入手机号码', rangelength: '手机号长度为11' },
							email: { required: '请输入Email地址', email: '无效的Email地址',}
							},
					errorPlacement: function(error, element) 
									{ 	
									if ( element.is(":radio") || element.is(":checkbox")) {
										error.appendTo( element.parent());} 
									else {error.insertAfter(element);} 
									}
		}); // end validate 
	}); // end all
	</script>
	<div id="test">
		<div class = "colM">
			<br>
			<h1>{{e.name}}</h1>
			<div id = "intro">
				{{e.intro|safe|linebreaks}}
			</div>
			<div id = "time">
				<h3>报名起始时间: </h3>
					{{e.begintime|date:'Y n.d,l H:i'}}
				<h3>报名结束时间: </h3>
					{{e.endtime|date:'Y n.d,l H:i'}}
			</div>
			<form action="" method="post" name="reg" id="reg">
				 <fieldset class="module aligned ">
					<div class="form-row">
						<div>
							<label for="name" class="required">Name:</label>
							<input name="name" type="text" id="name" class="vTextField"/>
						</div>
					</div>
					<div class="form-row">
						<div>
							<label for="sid" class="required">Student ID:</label>
							<input name="sid" type="text" id="sid" class="vTextField"/>
						</div>
					</div>
					<div class="form-row">
						<div>
							<label for="classno" class="required">Class Number:</label>
							<input name="classno" type="text" id="classno" class="vTextField"/>
						</div>
					</div>
					<div class="form-row">
						<div>
							<label for="phone" class="required">Phone:</label>
							<input name="phone" type="text" id="phone" class="vTextField"/>
						</div>
					</div>
					<div class="form-row">
						<div>
							<label for="email" class="required">Email:</label>
							<input name="email" type="text" id="email" class="vTextField"/>
						</div>
					</div>
					<div class="form-row">
						<div>
							<label for="sug" class="required">{{e.sugtitle}}</label>
							<textarea id="id_sug" rows="10" cols="40" name="sug" class="vLargeTextField"></textarea>
						</div>
					</div>
					<div class="form-row">
						<input name="submit" type="submit" value="submit"/>
					</div>
				 </fieldset>
			</form>
		</div>
		<div id = 'footer'>
			<hr>
			<center>Copyright &copy 2010 kevincat.info All Rights Reserved by 
				<a href = 'mailto:admin@kevincat.info'>k.c.</a>
			</center>
		</div>
	</div>
	{% endblock %}